home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
FromTheMag
/
JW FLV MEDIA PLAYER 4.2
/
mediaplayer.exe
/
player.swf
/
scripts
/
com
/
jeroenwijering
/
parsers
/
MediaParser.as
< prev
next >
Wrap
Text File
|
2008-11-04
|
2KB
|
58 lines
package com.jeroenwijering.parsers
{
import com.jeroenwijering.utils.Strings;
public class MediaParser extends ObjectParser
{
public function MediaParser()
{
super();
}
public static function parseGroup(param1:XML, param2:Object) : Object
{
var _loc3_:XML = null;
for each(_loc3_ in param1.children())
{
switch(_loc3_.localName())
{
case "content":
if(!param2["file"] && ObjectParser.MIMETYPES[_loc3_.@type.toString()])
{
param2["file"] = _loc3_.@url.toString();
param2["type"] = _loc3_.@type.toString();
if(_loc3_.@duration)
{
param2["duration"] = Strings.seconds(_loc3_.@duration);
}
if(_loc3_.@start)
{
param2["start"] = Strings.seconds(_loc3_.@start);
}
}
if(_loc3_.children().length() > 0)
{
param2 = parseGroup(_loc3_,param2);
}
break;
case "description":
param2["description"] = _loc3_.text().toString();
break;
case "thumbnail":
param2["image"] = _loc3_.@url.toString();
break;
case "credit":
param2["author"] = _loc3_.text().toString();
break;
case "keywords":
param2["tags"] = _loc3_.text().toString();
break;
}
}
return param2;
}
}
}